Skip to content

tool(ws): Switch ws runner to <workspace>:<script> syntax#797

Open
necolas wants to merge 1 commit into
mainfrom
commit-package-json
Open

tool(ws): Switch ws runner to <workspace>:<script> syntax#797
necolas wants to merge 1 commit into
mainfrom
commit-package-json

Conversation

@necolas

@necolas necolas commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes the workspace script runner from the space-separated bun ws <workspace> <script> form to a single <workspace>:<script> target token.

bun ws diffs:test            # was: bun ws diffs test
bun ws :test                 # run `test` in every workspace that defines it
bun ws 'packages/*:build'    # globs still supported in the package part

Behavior

  • The package part is everything before the first colon, so script names that themselves contain colons stay intact (e.g. bun ws docs:trees:dev → workspace docs, script trees:dev).
  • An empty package part (:test) fans out to every workspace, equivalent to '*:test'.
  • Fan-out runs the script only in workspaces that define it and skips the rest (bun's existing -F behavior). A single explicit workspace still errors on a missing script.
  • The old space-separated form now prints a helpful error pointing at the new syntax.

Call sites updated

Root tsc script, CI workflow, app build:deps, package READMEs, benchmark/profile usage strings, AGENTS.md, and the profile CLI test assertion.

Verification

  • bun run format clean; bun run lint shows only pre-existing findings in untouched files.
  • packages/trees/test/file-tree-profile-cli.test.ts passes (asserts the new usage string).
  • bun ws :test confirmed to fan out only to packages with a test script; error paths (old syntax, missing script, missing workspace, empty script) all verified.

Change the workspace script runner from a space-separated
`bun ws <workspace> <script>` form to a single `<workspace>:<script>`
target token. The package part is everything before the first colon, so
script names that contain colons (e.g. `docs:trees:dev`) stay intact.

An empty package part fans out to every workspace, so `bun ws :test`
runs `test` in every workspace that defines it, equivalent to `'*:test'`.
Globs in the package part are still supported (`'packages/*:build'`).
Fan-out only runs the script where it exists, which is bun's existing
`-F` behavior; a single explicit workspace still errors on a missing
script. The old space-separated form now prints a helpful error pointing
at the new syntax.

Update all call sites and docs: root and CI scripts, app `build:deps`,
package READMEs, benchmark/profile usage strings, and the profile CLI
test assertion.
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierre-docs-diffs Ready Ready Preview Jun 10, 2026 1:45am
pierre-docs-diffshub Ready Ready Preview Jun 10, 2026 1:45am
pierre-docs-trees Ready Ready Preview Jun 10, 2026 1:45am
pierrejs-diff-demo Ready Ready Preview Jun 10, 2026 1:45am

Request Review

@amadeus amadeus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Could we maybe have a shortcut for building all packages?

@SlexAxton

SlexAxton commented Jun 10, 2026 via email

Copy link
Copy Markdown
Contributor

@amadeus

amadeus commented Jun 10, 2026

Copy link
Copy Markdown
Member

@SlexAxton does that build apps too? or is that scoped to only packages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants